﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WCFMINERP.Update
{
    public partial class FrmSHACODE : Form
    {
        public FrmSHACODE()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtSHACODE.Text.Trim()))
            {
                Properties.Settings.Default.SHACODE = txtSHACODE.Text;
                Properties.Settings.Default.Save();
            }
            else
            {
                txtSHACODE.Focus();
                MessageBox.Show("请输入授权码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            this.Close();
        }

        private void FrmSHACODE_Load(object sender, EventArgs e)
        {
            txtSHACODE.Focus();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            if(DialogResult.OK ==MessageBox.Show("确定要退出系统吗？","询问",MessageBoxButtons.OKCancel,MessageBoxIcon.Question))
            {
                FrmLogin frm = (FrmLogin)this.Owner;
                frm.continueInput = false;
                this.Close();
                Application.Exit();
            }
        }
    }
}
